DEVICE HMI2

0.1 Introduction

HMI2 is a device designed to perform the functions of an interface between the user, a display up to 32 digit, leds (up to 32) and a keyboard (up to 32 keys). Manage 3 recursive contemporary views configurable each with its own number of characters, decimal point and position within the display. It also has the capability of data entry (introduction of a data via the keyboard) fully configurable than the number of characters, at the location and decimal digits with the ability to control the upper and lower limits of the data introduced.

0.2 Device declaration

The device declaration mode in the configuration unit is:

;----------------------------------------
; Internal device declarations
;----------------------------------------
<device_name>   HMI2	TCamp

Where:

<device_name>the name assigned to the device
HMI2keyword that identifies the device
TCampsample time device (3÷250 ms)
:important:Attenzione: È necessario che tutte le voci di definizione siano presenti sulla stessa linea

0.3 Operation

We analyze in more detail the characteristics of the HMI2 device.

0.3.1 The display

The display consists of a series of digits (characters) variables depending on the hardware platform of microQMove that you are using. For example, in a display digits D221 or D983 are 7, While the D231 digits arrive to 11.

The pictures are presented only as an example because the HMI2 device has an independent operation by the instrument that you are using.

0.3.2 Recursive views

For recursive view is a view that is updated continuously, more precisely at each sampling time of the device. With the HMI2 You can enable up to 3 of these, independent and positioned at within the display.
Depending on the number of characters that you configured the display, the display area is used by the view itself so that in that area can no longer write the characters because they would be immediately overwritten.

In the picture there is an example of how you might configure the views to your liking. In this case there are 2 views of 2 characters and the other of a recursive 3 characters placed respectively at position 8 and position 0. Recursive display from 3 characters also has the number of decimal places set to 1. In display not occupied by recursive views you can set the characters (numbers or letters) so that they are showed; You cannot set characters on display at locations 0,1,2 and 8,9 Because views to overwrite them recursive.
For each recursive display the maximum and minimum values that can be showed depends as mentioned by number of digits and the sign enable. If the data to be displayed is less than the minimum or greater than this maximum value, the display will shows the out of range characters.

0.3.3 Data entry

Data entry functionality allows the user to enter a numeric value from the keyboard as it can configure the number of characters entered, the position on the display, the position of the decimal point. You can also exit the data entry with a button at will, or with special commands. A particular parameter to bit field allows you to enable control of the value of the data introduced in the upper and lower limits (set using the appropriate parameters), to enable the introduction of signed or unsigned data, and other features of tables description parameters and commands. This configurability allows through a few instructions of Qcl language to meet the various needs of human-machine interface.

0.3.4 Keyboard functionality in data entry

We will now detail the instructions in order to introduce keyboard data specifying the key functions. The HMI2 device provides the user with two ways to insert data, the standards and how they increase/decrease.

0.3.4.1 Standard mode

The table summarizes the functions of each key:

KeyFunctionality
ENTER keyConfirmation of the introduced data: bounds checking of the datas in introduction (If enabled with the appropriate bits of the deflags parameter), copy the input value to the devalue parameter and produces the output from the insert data function.
CLEAR keyDelete/restore of data: execute alternately zeroing data in introduction, and restoration of its initial value.
PLUS keyIncreases selected digit: execute the increase of the selected number.
MINUS keySelection digit: moves the selection of the digit on the right than the one selected.

0.3.4.2 Increase/decrease mode

The table summarizes the functions of each key:

KeyFunctionality
ENTER keyConfirmation of the introduced data: execute the bounds checking of the data in introduction (if enabled with the appropriate bits of the deflags parameter), copy the input value to the devalue parameter and produces the output from the function to insert data.
CLEAR keyDelete/restore of data: execute alternately zeroing introduction data, and the restoration of its initial value.
PLUS keyIncrease value in introduction: execute the increase in introduction. While pressing the button, the growth is continuous and with speed which exponentially increases.
MINUS keyDecrease value in introduction: execute the decrease in value in introduction. While pressing the button, the decrease is continuous and with speed which exponentially increases.

When the zero bits of the deflags parameter is 0 the DATAENTRY functionality can be used for a easy view. This feature can be handy when the figure has a static value and therefore do not need to use recursive views. For example, if you need to display an error message and the error code itself for some time, the function that displays such a message can be achieved without having to alter the programming of recursive views.

This section shows the bit assignments of variables in charge in addition to the keys and leds on the various hardware MicroQmove.

0.3.5.1 Keyboard, display and leds for D221 series

In summary:

KeyValue key parameter
ENTER key1
CLEAR key8
PLUS key4
MINUS key32
F key16
F + CLEAR keys24

Offset value in relation with the digit

Name of dis0…31 parameters in relation to the digit

0.3.5.2 Keyboard, display and leds for D231 series

In summary:

KeyValue of key parameter parametro key
ENTER key1
CLEAR key8
PLUS key4
MINUS key32
F key16
F + CLEAR keys24

0.3.6 Values of the dis0÷31 variables

In this section shows the codes to use for viewing the and special characters. This codes must be used for the dis0÷31 parameters.

ValueCharacterValueCharacterValueCharacterValueCharacter
0014E28J42~
1115F29c43M
2216G30h44&
3317H31!45[
4418I32@46]
5519L33-47;
6620n34u48,
7721o35 49:
8822P36_50.
9923Q37=518.
10a24r38$
11b25t39*
12c26U40^
13d27Y41%
:info:Note: the bit 7 (corresponding to the -128 decimal value) of the dis0÷31 paramters can be used with each character to also display the decimal point. If we define the following constant in units of configuration:
CHAR_POINT &H80 ; bit to enable decimal point
you will be able to print dotted decimal strings easily. Ad esempio per stampare: “Prnr”
dvHMI:dis6 = CHAR_P
dvHMI:dis5 = CHAR_R ORB CHAR_POINT
dvHMI:dis4 = CHAR_N
dvHMI:dis3 = CHAR_R ORB CHAR_POINT

0.4 Parameters table

Name Dimension Default value Access type Unit of measure Valid range Write conditions Description
key Long - R - - - State of the keys
Is a parameter to a bit field each representing the state of the modifier keys. Bit binding to keys refer to the appendices.
leds Long 0 RW - - - State of the leds
Is a parameter to a bit field each representing the state of the leds. By changing the value for each led can be turned on and off; for the sssociation of the bits to leds refer to the appendices.
blinkleds Long 0 RW - - - State of the leds
Represents the blink status at any time in the keyboard led. This variable can also be changed from the device when actions are executed in the keyboard. Bit mapping reflects that of the parameter leds. Because an led flashes it must be activated by the appropriate bit of variable leds.
numdis Byte - R - - - Number of the available displays
Represents the number of the available displays. Depending on the hardware platform (D221 or D231 etc) on which the device will be used, this parameter will take on different values. For example on D231 will have the value 11.
dis0÷31 Byte - RW - - - Character viewing
Represents the current contents of the display font in 0…31 positions. dis0 is the rightmost display and dis31 is the leftmost.
blinkchar Long 0 RW - - - Flashing character
It's a bit variable to enable the blink on a character. Each bit is a character. The least significant bit is associated with the rightmost display.
ScreenA Long 0 RW - - - Value for recursive view
It's a value to be recursively showed if enabled.
ScreenB Long 0 RW - - - Value for recursive view
It's a value to be recursively showed if enabled.
ScreenC Long 0 RW - - - Value for recursive view
It's a value to be recursively showed if enabled.
decptA Byte 0 RW - 0÷5 - Decimal point for recursive view
It is the position of the decimal point in the recursive view A.
decptB Byte 0 RW - 0÷5 - Decimal point for recursive view
It is the position of the decimal point in the recursive view B.
decptC Byte 0 RW - 0÷5 - Decimal point for recursive view
It is the position of the decimal point in the recursive view C.
ncharA Byte 0 Read - Write - 1÷7 - Number of characters to display recursive
It is the number of characters that make up the recursive view A.
ncharB Byte 0 RW - 1÷7 - Number of characters to display recursive
It is the number of characters that make up the recursive view B.
ncharC Byte 0 RW - 1÷7 - Number of characters to display recursive
It is the number of characters that make up the recursive view C.
offsA Byte 0 RW - 0÷numdis-1 - Recursive view location
It's location right display of the recursive view A. Valid range: 0 ÷ numdis-1.
offsB Byte 0 RW - 0÷numdis-1 - Recursive view location
It's location right display of the recursive view B. Valid range: 0 ÷ numdis-1.
offsC Byte 0 RW - 0÷numdis-1 - Recursive view location
It's location right display of the recursive view C. Valid range: 0 ÷ numdis-1.
scflags Word 0 RW - - - Configuration for recursive views
Is a value to bit fields to configure the recursive screenA, screenB and screenC views.
Bit Value Description
0 0 Recursive view screenA disabled
1 Recursive view screenA enable
1 0 Recursive view screenB disabled
1 Recursive view screenB enable
2 0 Recursive view screenC disabled
1 Recursive view screenC enable
3 0 Recursive view sign screenA disabled
1 Recursive view sign screenA disabled
4 0 Recursive view sign screenB disabled
1 Recursive view sign screenB disabled
5 0 Recursive view sign screenC disabled
1 Recursive view sign screenC disabled
6 0 Leading Zero Blank screenA disabled
1 Leading Zero Blank screenA enabled
7 0 Leading Zero Blank screenB disabled
1 Leading Zero Blank screenB enabled
8 0 Leading Zero Blank screenC disabled
1 Leading Zero Blank screenC enabled
devalue Long 0 RW - - - Data entry value
Data value in data entry. Is updated with the input value upon exit from the data entry.
denchar Byte 0 RW - 1÷7 - Number of characters entered in data entry
Sets the number of characters entered for data entry.
deoffs Byte 0 RW - 0÷numdis-1 - Data entry position on the display
Sets the position on the display, compared to the rightmost digit, of the data entry.
dedecpt Byte 0 RW - 0÷5 - Number of decimal digital for data entry
Indicates the number of decimal places for data entry.
deuplim Long 0 RW - - - Maximum data value introduced with data entry
Is the maximum value that can be given with data entry senza activate the flag signaling of exceeding the upper limit.
delowlim Long 0 RW - - - Minimum value of the data introduced with data entry
Is the minimum value that can be take with the data entry without active lower limit signal flag.
deflags Word 0 RW - - - Configuration for data entry
It's a value to bit fields to configure the Data Entry.
Bit Value Description
0 0 View only
1 Introduction data
1 0 Leading Zero Blank not active (valid only for viewing then with bit 0 = 0)
1 Leading Zero Blank active (valid only for viewing then with bit 0 = 0)
2 0 Introduction/viewing sign enable
1 Introduction/viewing sign disable
3 0 Standard Data Entry
1 Data entry with +/- key as to increase decrease
4 0 Control limits disabled
1 Control limits enabled
deExKeymask Long - RW - - - Output configuration buttons to data entry
Enable mask of the exit key to the data entry. Is a bitmask that enables one or more keys to exit the data entry. The correspondence of the key bits is equal of the key parameter. Regardless of the value set in this parameter the ENTER key will exit to the data entry.
deExitKey Long - R - - - Output viewing key to the data entry
Is a value to a bit field indicating the key that brought out to the data entry. The correspondence of the bit with key is the equal of the key parameter. If the value is 0 means you are signed out of data entry with EXITDE and EXITDEC commands.
errcode Byte 0 RW - 0÷100 - Error identification code
When the HMI2 device cannot execute operations are caused by incorrect user programming reports this condition through activation of the st_error state. The HMI2 device, makes available, through the values of the errcode and ervalue variables, some information for a better understanding of the type of error and what condition the generated. This information and the st_error error status, continue until you run the appropriate RSERR command that deletes them. The following table specifies the values from the errcode variable:
Code Description
0 No errors
1 Reports an error in the parameterization of recursive view A.
2 Reports an error in the parameterization of recursive view B.
3 Reports an error in the parameterization of recursive view C.
4 Reports an error in the parameters of the data entry.
errvalue Byte 0 RW - 0÷100 - Identifying code of cause of the error
Through the errvalue variable you can get more detailed information about the error.
The following table specifies the values from the errvalue variable:
Code Description
0 No details about the error
1 Signals that the viewing comes up on the display. Check the offset of the view and the number of characters.
2 Note that the decimal point position specified is incorrect. For example, you cannot set the decimal point position equal to the number of characters.
3 Indicates that the uplim parameter (upper data entry limit) is less than lowlim (lower data entry limit). The error does not occur if the limit checking is disabled.
4 Reports an invalid value data for dataentry confirmed with the EXITDEC command.
5 Report a collision between two recursive view or between one recursive view and the data entry. For collision refers to the use of a display area by multiple objects (recorsive views or data entry).
6 Indicates that the sign is not valid. Occurs when you set a number 1 characters and the sign is enabled. Increase the number of the characters (minimum 2) or disable the sign.
wrncode Byte 0 RW - 0÷100 - Identification code warning
When the parameters of the HMI2 device are programmed with out-of-range values they are not accepted and maintain their previous value. The device reports this condition through activation of the st_warning state. The HMI2 device, makes available, through the values of the wrncode and wrnvalue variables, some information to better understand the type of warning and what condition the generated. This information and the st_warning error status, continue until you execute the appropriate RSWRN command that will remove them.
The following table specifies the values from the variable wrncode:
Code Description
0 No warning
1 Report a warning in the parameterization of recursive view A.
2 Report a warning in the parameterization of recursive view B.
3 Report a warning in the parameterization of recursive view C.
4 Report a warning in thedata entry parameterization.
5 Report a warning had to request of the EXITDE or EXITDEC command execution without that data entry is active (state st_dentry=0)
6 Report a warning had to request of the DATAENTRY command execution with the data entry already active (state st_dentry=1).
wrnvalue Byte 0 RW - 0÷100 - Identification code of the cause of warning
Through the wrnvalue variable you can get more detailed informations about the error.
The following table specifies the values from the wrnvalue variable:
Code Description
0 No details about the error
1 FIXME Segnala che la posizione del punto decimale specificata è fuori range.
2 Segnala che il numero di caratteri specificato è fuori range.
3 Segnala che l'offset specificato è fuori range (superiore al numero dei display presenti)
4 Segnala una collisione tra due visualizzazioni ricorsive o tra una visualizzazione ricorsiva ed il data entry. Per collisione si intende l'utilizzo di una zona del display da parte di più oggetti (visualizzazioni ricorsive o data entry).

0.5 Tabella stati

NomeValore di defaultDescrizione
st_modified0Data entry modificato
Segnala che il dato in data entry è stato modificato.
st_dentry0Stato data entry
Segnala che il device è in data entry.
st_uplim0Stato di superamento limite superiore
Segnala che il dato introdotto è superiore al valore impostato nel parametro deuplim. Azzerato dal comando DATAENTRY ed aggiornato all'uscita dal data entry con conferma del dato.
st_lowlim0Stato di superamento limite inferiore
Segnala che il dato introdotto è inferiore al valore impostato nel parametro delowlim. Azzerato dal comando DATAENTRY ed aggiornato all'uscita dal data entry con conferma del dato.
st_exitcmd0Stato di uscita con comando EXITDE
Segnala l'uscita dal data entry con comando EXITDE. Azzerato dal comando DATAENTRY ed aggiornato all'uscita dal data entry.
st_error0Presenza di un errore
Indica lo stato di errore del device, per riconoscere il tipo di errore si deve far riferimento alle variabili errcode ed errvalue:
0: errore non presente,
1: errore presente
st_warning0Presenza di un warning
Indica lo stato di warning del device, per riconoscere il tipo di warning si deve far riferimento alle variabili wrncode e wrnalue:
0: warning non presente,
1: warning presente

0.6 Tabella comandi

NomeCondizioneDescrizione
DATAENTRYst_dentry=0Entra nella procedura data entry
Permette di entrare nella procedura di data entry.
EXITDEst_dentry=1Esce dalla procedura data entry
Permette di uscira dalla procedura di data entry.
EXITDECst_dentry=1Esce dalla procedura data entry dopo conferma
Permette di uscire dalla procedura di data entry con conferma del dato in introduzione (come se avessimo premuto il tasto ENTER).
RSERRst_error=1Reset dello stato di errore
Azzera lo stato st_error.
RSWRNst_warning=1Reset dello stato di warning
Azzera lo stato st_warning.